import request from '@/utils/request'


// 查询小档案列表
export function listTerminalxbAll(query) {
  return request({
    url: '/basedata/terminalxb/listAll',
    method: 'get',
    params: query
  })
}


// 查询小档案列表
export function listTerminalxb(query) {
  return request({
    url: '/basedata/terminalxb/list',
    method: 'get',
    params: query
  })
}
export function gjListTerminalxb(query) {
  return request({
    url: '/basedata/terminalxb/gjList',
    method: 'get',
    params: query
  })
}

export function listTerminalxbForGJ(query) {
  return request({
    url: '/basedata/terminalxb/listForGJ',
    method: 'get',
    params: query
  })
}


// 查询小档案详细
export function getTerminalxb(ID) {
  return request({
    url: '/basedata/terminalxb/' + ID,
    method: 'get'
  })
}

// 新增小档案
export function addTerminalxb(data) {
  return request({
    url: '/basedata/terminalxb',
    method: 'post',
    data: data
  })
}

// 修改小档案
export function updateTerminalxb(data) {
  return request({
    url: '/basedata/terminalxb',
    method: 'put',
    data: data
  })
}

// 删除小档案
export function delTerminalxb(ID) {
  return request({
    url: '/basedata/terminalxb/' + ID,
    method: 'delete'
  })
}

// 获取未绑定户表
export function getnobind(){
  return request({
    url: '/basedata/terminalxb/listNoBound',
    method: 'get'
  })
}

// 销表
export function cancelterminal(data){
  return request({
    url: '/basedata/terminalxb/cancelTerminal',
    method: 'put',
    data: data
  })
}
// 远程控制
export function remoteControl(data){
  return request({
    url:'/basedata/terminalxb/createCommand',
    method: 'post',
    params: data
  })
}

// 单表注册
export function registerSingle(data){
  return request({
    url:'/basedata/terminalxb/createGuoXinDeviceInAep',
    method: 'post',
    params: data
  })
}

// 根据locationNb查户表档案详情
export function getByLocationNb(locationNb){
  return request({
    url: '/basedata/terminalxb/getByLocationNb?locationNb=' + locationNb,
    methods: 'get',
  })
}

// 换表
export function changeTerminalXb(data){
  return request({
    url: '/basedata/terminalxb/changeTerminalXb',
    method: 'post',
    data: data,
  })
}
// 表过户
export function changeTerminalUser(data,terminalId, newUser) {
  return request({
    url: '/basedata/terminalxb/changeTerminalUser/' + terminalId + '?newUser=' + newUser,
    method: 'post',
    data: data,
  })
}

